cmake_minimum_required(VERSION 2.8)
project(test_kratos_core)

set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wno-invalid-source-encoding")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wno-invalid-source-encoding")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

add_definitions("-m64 -g -Wall -Wno-overloaded-virtual -fstack-protector -fstack-protector-all -Wno-unused-private-field")

link_directories("/usr/lib64/mysql")

set(TEST_LIBS -lpthread
		  -lrt
		  -ldl
	  	 /usr/local/lib/libkratos_core.a
                 -lmysqlclient
                 /usr/local/lib/libhiredis.a
)
aux_source_directory(. TEST_SRC)
aux_source_directory(./unittest/ TEST_SRC)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

add_executable(
	test_kratos_core
    ../engine/protocol_analyzer_impl.cpp
	${TEST_SRC}	
)

target_link_libraries(
	test_kratos_core
	${TEST_LIBS}
)
